home *** CD-ROM | disk | FTP | other *** search
/ Plug-In Power Pack for Netscape Communicator / Plug-In Power Pack for Netscape Communicator.iso / plugins / dataviews / include / vostd.h < prev    next >
C/C++ Source or Header  |  1997-05-08  |  31KB  |  861 lines

  1. /*
  2. |    file name -- VOstd.h
  3. |===================================================================
  4. |
  5. |    Copyright (c) 1987-90 V.I. Corporation
  6. |
  7. |    VOstd.h - Declarations and defines for users of drawing system
  8. |
  9. |    Written by Alan C. Morse    9 Feb 84
  10. |
  11. |    Revision history:
  12. |    alan c morse    24 Jan 86    Move OT_* constants from VO.h
  13. |    alan c morse    23 Dec 86    Add Input object stuff
  14. |    alan c morse    14 Apr 87    Add DRAW_INFO
  15. |    alan c morse    27 May 87    Add ASSIGN_OBJECT
  16. |       russell turner & daniel dee
  17. |                       17 sep 87       New attribute fields
  18. |    russell turner    27 Oct 87    Default constants for attributes
  19. |                    Attribute field name constants
  20. |                    (VOuAttr)
  21. |    russell turner    22 Jan 88    TOP and BOTTOM flags for VOdqAdd
  22. |    russell turner    26 Feb 88    More flags
  23. |    alan c morse    27 apr 90    Add VOSK* flags
  24. |    john methot    18 dec 90    Add SD_DYN_ENABLED,
  25. |                    SD_DYN_DISABLED, SD_DYN_NONE
  26. |    kathy madison    1 jan 91    Add flags for Visiblity and 
  27. |                     Text dynamics.
  28. |    chris hoffmann    23 jan 91    flags for images and icons
  29. |    charlie hileman    22 feb 91    changed dynamic flag names
  30. |    alan morse    16 sep 91    Add OT_REFCOLOR
  31. |       mike krasnik    16 sep 91       Add DRAW_ENV.
  32. |       lynn smith      12 Apr 94       Change DV_TRANSPARENT, DV_ABSOLUTE,
  33. |                                       DV_RELATIVE, and DV_SUCCESS to DV_*.
  34. |
  35. |    * It may be advisable from now on to record changes as part
  36. |      of SCCS using the comment facility in SCCS.
  37. |-------------------------------------------------------------------
  38. |
  39. |    This header is for users of the VO routines.  It contains
  40. |    the externally visible data types and parameter definitions
  41. |    for those routines.  This is in contrast to the VO.h header
  42. |    which contains the definitions and data types that are
  43. |    only used within the VO routines.
  44. |
  45. |    NOTE TO IMPLEMENTERS:  Care must be taken to make sure that
  46. |    the typedefs include here are compatible with the corresponding
  47. |    internally visible forms in VO.h.
  48. |
  49. |===================================================================
  50. */
  51. #ifndef VOSTD_H
  52. #define    VOSTD_H
  53. /*-----------------------------------------------------------------
  54. |
  55. |    OBJECT
  56. |    A fundamental entity in the drawing system is the OBJECT,
  57. |    which is implemented as an abstract data type that has its
  58. |    type internally specified.  OBJECTs are defined in terms
  59. |    of other OBJECTs and primitive constants.
  60. */
  61. #ifdef OBJECT
  62. #undef OBJECT
  63. #endif
  64. typedef LONG OBJECT;
  65. typedef UBYTE O_TYPE; /* Object type */
  66.  
  67. /*------------------------------------------------------------------
  68. |
  69. |    DATUM
  70. |    More general than an OBJECT is a DATUM, which includes an
  71. |    OBJECT as a subtype.  A DATUM type is externally specified,
  72. |    that is, how it is interpreted depends on its context.  
  73. |    Therefore, unlike an OBJECT, interpreting a DATUM requires
  74. |    passing flags around that describe what it is.  The values
  75. |    for the flags are defined below.
  76. |
  77. |    A DATUM can be a: pointer to a DV_TEXT string, a float, an
  78. |    INTEGER, or an OBJECT.  The DATUM TYPE flags indicate which
  79. |    of these classes it is.  Furthermore, if the DATUM is an
  80. |    OBJECT, the DATUM TYPE flag indicates what type of OBJECT
  81. |    it is.
  82. */
  83. typedef LONG DATUM;
  84. typedef int DATUM_TYPE;
  85.  
  86. /* Flags for the different types in the DATUM */
  87. /* And MACROS for testing this flags. */
  88. #define FLOAT_DATUM        ((DATUM_TYPE)('f'))
  89. #define IS_FLOAT_DATUM(datype)    ((datype)==FLOAT_DATUM)
  90. #define INT_DATUM        ((DATUM_TYPE)('i'))
  91. #define IS_INT_DATUM(datype)    ((datype)==INT_DATUM)
  92. #define OBJECT_DATUM(obtype)    ((DATUM_TYPE)('O')|(DATUM_TYPE)(obtype<<8))
  93. #define IS_OBJECT_DATUM(datype)    (((datype)&0xFF)==('O'))
  94. #define DATUM_O_TYPE(datype)    (((datype)>>8)&0xFF)
  95. #define TEXT_DATUM        ((DATUM_TYPE)('t'))
  96. #define IS_TEXT_DATUM(datype)    ((datype)==TEXT_DATUM)
  97.  
  98. /*===================================================================
  99. |
  100. |    DATUM_DESC
  101. |    This is the unpacked form of the above data type.
  102. |    In general, use a DATUM type to pass the data around, when
  103. |    you don't care about its actual contents. Use the DATUM_DESC
  104. |    type or the macros described below, to look at the contents.
  105. |
  106. |    Representing the type externally is done to improve space
  107. |    and time efficiency at the expense of ease of use.
  108. */
  109. typedef union
  110.   {
  111.   DATUM DATUM_alias;
  112.   float f;
  113.   LONG i;
  114.   OBJECT O;
  115.   char *t;
  116.   } DATUM_DESC;
  117.  
  118. /*===================================================================
  119. |
  120. |    ATTRIBUTES
  121. |    This is the structure describing the union of all the attributes
  122. |    of the graphical objects.  This structure is used to as an
  123. |    argument block to the routines that manage the graphical objects
  124. |    and that manage the user-interface.  Thus, the structure acts
  125. |    as a means of handling/communicating graphical attributes
  126. |    throughout the drawing editor system.  Most objects will only
  127. |    look at a portion of the structure, ignoring the inappropriate
  128. |    entries.  Note that there is be a special entry, EMPTY_FIELD,
  129. |    that indicates "no entry in this field."  Entries that may be
  130. |    dynamic are declared as OBJECT.  Static entries are declared to
  131. |    be the smallest size that can be used to hold them.
  132. */
  133. #define EMPTY_FIELD         -2
  134. #define EMPTY_FLOAT_FIELD    -99999.0
  135.  
  136.  
  137. typedef struct ATTRIBUTES
  138.   {
  139.   OBJECT foreground_color; /* A NULL color means that this color
  140.     | is to be inherited. */
  141.   OBJECT background_color; /* A NULL color means that this color
  142.     | is to be inherited. */
  143.   char line_width; /* Width of LINE object, reasonable values are
  144.     | in the range [1(default),3] */
  145.   char line_type; /* Line type of LINE object */
  146. #   define SOLID_LINE    ((char)1)
  147.   char fill_status; /* Is the object to be filled or has borders?  */
  148. #   define EDGE          ((char)('u')) /* originally FILLED_OBJECT */
  149. #   define DV_TRANSPARENT          ((char)('t'))
  150. #   define FILL            ((char)('f')) /* originally UNFILLED_OBJECT */
  151. #   define FILL_WITH_EDGE    ((char)(0xFB))
  152. #   define EDGE_WITH_FILL    ((char)(0xBF))
  153. #   define FILLED_OBJECT    FILL
  154. #   define UNFILLED_OBJECT    EDGE
  155.   char text_direction; /* Direction that text will be drawn: */
  156. #   define HORIZONTAL_TEXT    ((char)('h'))
  157. #   define VERTICAL_TEXT    ((char)('v'))
  158.   char text_position; /* Indicates the position of the text
  159.     | with respect to the anchor point.  Possible values: */
  160. #   define AT_TOP_EDGE        ((char)(0x1))
  161. #   define AT_BOTTOM_EDGE    ((char)(0x2))
  162. #   define AT_LEFT_EDGE        ((char)(0x4))
  163. #   define AT_RIGHT_EDGE    ((char)(0x8))
  164. #   define CENTERED        ((char)(0x10))
  165. #   define POSITION_FLAGS_MASK    ((char)(0x1F))  /* OR of above flags */
  166.   char text_font; /* Text font to use.  Default is 0 */
  167.   char text_size; /* Size of text to draw. Reasonable values are
  168.     | in the range [1,3] */
  169.   char arc_direction; /* Direction (clockwise of counter-clockwise) to
  170.     | use in drawing an arc between two intersecting lines. Possible
  171.     | values are: */
  172. #   define CLOCKWISE        ((char)('r'))
  173. #   define COUNTER_CLOCKWISE    ((char)('l'))
  174.   char curve_type;  /* Used by the POLYGON object to determine the
  175.     | the type of the curve defined by the POLYGON.  The curve is
  176.     | either a cubic b-spline with one of three end conditions or
  177.     | a set of straight lines (the default when this field is NULL).
  178.     | Possible values: */
  179. #   define FLOATING_ENDS    ((char)('f'))
  180. #   define OPEN_ENDS        ((char)('o'))
  181. #   define CLOSED_ENDS        ((char)('c'))
  182.  
  183. /************************************************ vector text fields **********/
  184.  
  185.   char *text_fontname;        /* file name of text font */
  186.   float text_width;        /* horizontal text expansion factor */
  187.   float text_height;        /* vertical text expansion factor */
  188.   float text_angle;        /* cc angle of text baseline from horizontal */
  189.   float text_slant;        /* clockwise angle of text slant from vertical*/
  190.   float text_charspace;        /* inter-character spacing fraction */
  191.   float text_linespace;        /* inter-line spacing fraction */
  192.   int text_underline;           /* underlining */
  193.   int text_weight;              /* typographic weight */
  194. #   define  NORMAL_WEIGHT    400
  195. #   define  BOLDFACE_WEIGHT    700
  196.   int text_ptsize;        /* size of font in typographic tenths of points */
  197.  
  198. /****************************** node and edge fields *****************/
  199.   char *name;            /* Name of object */
  200.  
  201.   RECTANGLE *node_bounds;    /* Bounding box of node */
  202.  
  203.   char edge_type;        /* Type of edge */
  204. #   define DIRECTED_EDGE    ((char)('d'))
  205. #   define UNDIRECTED_EDGE    ((char)('u'))
  206.  
  207. /****************************** Proportional fill flags *****************/
  208.   char prop_fill;        /* Use proportional fill? What type?*/
  209. #   define PROP_FILL_NONE    ((char)0)
  210. #   define PROP_FILL_RIGHT    ((char)1)
  211. #   define PROP_FILL_UP        ((char)2)
  212. #   define PROP_FILL_LEFT    ((char)3)
  213. #   define PROP_FILL_DOWN    ((char)4)
  214.   short fill_amount;        /* Proportion of area to fill [0...32k] */
  215.   
  216.   } ATTRIBUTES;
  217.  
  218. /***************************************************************************
  219.  *
  220.  *    Default attribute field values
  221.  *
  222.  ***************************************************************************/
  223.  
  224. #define DEF_BACKGROUND_COLOR    ((char)NULL)
  225. #define DEF_FOREGROUND_COLOR    ((char)NULL)
  226. #define DEF_LINE_WIDTH        ((char)1)
  227. #define DEF_LINE_TYPE        SOLID_LINE
  228. #define DEF_FILL_STATUS        UNFILLED_OBJECT
  229. #define DEF_TEXT_DIRECTION    HORIZONTAL_TEXT
  230. #define DEF_TEXT_POSITION    CENTERED
  231. #define DEF_TEXT_FONT        ((char)0)
  232. #define DEF_TEXT_SIZE        ((char)2)
  233. #define DEF_ARC_DIRECTION    COUNTER_CLOCKWISE
  234. #define DEF_CURVE_TYPE        (char)NULL
  235. #define DEF_VFONT_SIZE          1024
  236. #define DEF_TEXT_CHARSPACE      (0.0F)
  237. #define DEF_TEXT_LINESPACE      (0.0F) 
  238. #define DEF_TEXT_WIDTH          (1.0F)
  239. #define DEF_TEXT_HEIGHT         (1.0F)
  240. #define DEF_TEXT_ANGLE          (0.0F)
  241. #define DEF_TEXT_SLANT          (0.0F)
  242. #define DEF_TEXT_FONTNAME       "roman.vf"
  243.  
  244. #define DEF_TEXT_PTSIZE         120
  245.  
  246. #define DEF_SFTEXT_HEIGHT        0.0
  247.  
  248. #define DEF_SFTEXT_WIDTH         0.0
  249. #define DEF_SFTEXT_FONTNAME      "Times New Roman"
  250. #define DEF_TEXT_UNDERLINE      0
  251. #define DEF_TEXT_WEIGHT         NORMAL_WEIGHT
  252. #define    DEF_NAME        NULL
  253. #define    DEF_NODE_BOUNDS        NULL
  254. #define DEF_EDGE_TYPE        UNDIRECTED_EDGE
  255. #define DEF_PROP_FILL        PROP_FILL_NONE
  256. #define DEF_FILL_AMOUNT        SHORT_MAX
  257.  
  258. /***************************************************************************
  259.  *
  260.  *    Attribute field enumerated constants
  261.  *    for use by VOuAttr routine
  262.  *
  263.  ***************************************************************************/
  264.  
  265. #define FOREGROUND_COLOR    1
  266. #define BACKGROUND_COLOR    2
  267. #define LINE_WIDTH        3
  268. #define LINE_TYPE        4
  269. #define FILL_STATUS        5
  270. #define TEXT_DIRECTION        6
  271. #define TEXT_POSITION        7
  272. #define TEXT_FONT        8
  273. #define TEXT_SIZE        9
  274. #define ARC_DIRECTION        10
  275. #define CURVE_TYPE        11
  276. #define TEXT_FONTNAME        12
  277. #define TEXT_WIDTH        13
  278. #define TEXT_HEIGHT        14
  279. #define TEXT_ANGLE        15
  280. #define TEXT_SLANT        16
  281. #define TEXT_CHARSPACE        17
  282. #define TEXT_LINESPACE        18
  283. #define TEXT_NAME        19
  284. #define NODE_BOUNDS        20
  285. #define EDGE_TYPE        21
  286. #define PROP_FILL        22
  287. #define FILL_AMOUNT        23
  288. #define TEXT_UNDERLINE          24
  289. #define TEXT_WEIGHT             25
  290. #define TEXT_PTSIZE             26
  291.  
  292. #define V_DYN_ROTATE        30
  293. #define V_DYN_PATH_MOVE        31
  294. #define V_DYN_REL_MOVE_X    32
  295. #define V_DYN_REL_MOVE_Y    33
  296. #define V_DYN_ABS_MOVE_X    34
  297. #define V_DYN_ABS_MOVE_Y    35
  298. #define V_DYN_SCALE        36
  299. #define V_DYN_SCALE_X        37
  300. #define V_DYN_SCALE_Y        38
  301. #define V_DYN_SUBDRAWING    39
  302.  
  303. #define V_DYN_FILL_RIGHT    40
  304. #define V_DYN_FILL_UP        41
  305. #define V_DYN_FILL_LEFT        42
  306. #define V_DYN_FILL_DOWN        43
  307.  
  308. #define V_DYN_TEXT        44
  309. #define V_DYN_VISIBILITY    45
  310.  
  311. /* Useful visibility and pickability masks */
  312. #define V_DYN_ALWAYS_MASK        0xffffffff
  313.  
  314. /* ================================================== *\
  315.  * erase technique defines for dynamic object updates *
  316. \* ================================================== */
  317.  
  318. #define V_DYN_ERASE_REDRAW_DELAY    1
  319. #define V_DYN_ERASE_RASTER        2
  320. #define V_DYN_ERASE_OBJECT        3
  321. #define V_DYN_ERASE_XOR            4
  322. #define V_DYN_ERASE_NONE        5
  323. #define V_DYN_ERASE_REDRAW_IMMEDIATE    6
  324. #define V_DYN_ERASE_BOX            7
  325. #define V_DYN_ERASE_BGCLR        V_DYN_ERASE_OBJECT
  326. #define V_DYN_ERASE_REDRAW            V_DYN_ERASE_REDRAW_DELAY
  327.  
  328. /* ================================================== *\
  329.  * dynamic_flag values for subdrawings                *
  330. \* ================================================== */
  331. #define SD_DYN_NONE        0
  332. #define SD_DYN_DISABLED        1
  333. #define SD_DYN_ENABLED        2
  334. #define SD_DYN_RESET        3
  335.  
  336. /* Max number of embedded subdrawing levels */
  337. #define V_MAX_SD_LEVELS     100
  338.  
  339. /*==========================================*/
  340. /* typedef's for traversal functions */
  341. typedef DV_BOOL (*VODYPARENTTRVRSFUNPTR) V_P_((OBJECT subobj,
  342.                            ADDRESS testargs));
  343. typedef DV_BOOL (*VOSDTOPTRVRSFUNPTR) V_P_((OBJECT subobj, ADDRESS testargs));
  344.  
  345. /*==========================================*/
  346. /* Useful system-wide parameter definitions */
  347. /* Return codes for certain classes of routines */
  348. #ifdef DV_SUCCESS
  349. #undef DV_SUCCESS
  350. #endif
  351. #ifdef DV_FAILURE
  352. #undef DV_FAILURE
  353. #endif
  354. #define DV_SUCCESS 1
  355. #define DV_FAILURE 0
  356.  
  357. /* Maximum and minimum absolute coordinates allowed in a DRAWING. */
  358. #define XMAX 16383
  359. #define YMAX 16383
  360. #define XMIN -16384
  361. #define YMIN -16384
  362.  
  363. /* Maximum and minimum values that will fit in a DV_COORD type */
  364. #define MAXCOORD 32767
  365. #define MINCOORD -32768
  366.  
  367. /*====================================================================
  368. |
  369. |    FLAGS used in calling VO routines.  These FLAG values are defined
  370. |    here for use by those who call those routines.
  371. */
  372. /* Special flag to Get/Set type functions, which flag means */
  373. /* that the value should NOT be set.  That is, the current */
  374. /* value should be returned, without changing it. */
  375. /* This is a number that is invalid for all the functions */
  376. /* for which it is used. */
  377. #define DONT_SET_THE_VALUE ((OBJECT)-2)
  378.  
  379. /* special flag to terminate variable length parameter lists */
  380. #define VI_ARG_END -1
  381.  
  382. /*====================================================================
  383. |
  384. |    Traversal typedef VOxxTraverse
  385. */
  386. typedef ADDRESS (*TOBFOREACHSUBOBJFUNPTR) V_P_((OBJECT subobj,
  387.                         ADDRESS argblock));
  388. typedef ADDRESS (*TOBFOREACHVDPFUNPTR) V_P_((OBJECT subobj,
  389.                          VARDESC vdp,
  390.                          ADDRESS argblock));
  391. typedef BOOLPARAM (*VOOBTRAVERSEFUNPTR)V_P_((OBJECT subobj,
  392.                          ADDRESS testargs));
  393. typedef void (*VOGATFILLFUNPTR)V_P_((ADDRESS fillargs, RECTANGLE *vp,
  394.                      RECTANGLE **obsvps));
  395. typedef void (*VOGATEDGEFUNPTR)V_P_((ADDRESS fillargs, RECTANGLE *vp,
  396.                      RECTANGLE **obsvps));
  397. typedef void (*VOGDRAWFUNPTR) V_P_((ADDRESS drawargs));
  398. typedef OBJECT (*VODQADDFUNPTR) V_P_((OBJECT entity));
  399. typedef void (*VODQDELFUNPTR) V_P_((OBJECT entity));
  400. typedef BOOLPARAM (*VODQEQUALFUNPTR) V_P_((OBJECT entity1, OBJECT entity2));
  401. typedef int (*VODQCOMPAREFUNPTR) V_P_((OBJECT entity1, OBJECT entity2));
  402. typedef ADDRESS (*VODRNAMETRVRSFUNPTR) V_P_((int position, OBJECT object,
  403.                       char *name));
  404. typedef void (*VOITECHOFUNPTR)V_P_((OBJECT Input, int Origin, int State,
  405.                 double *Value, VARDESC Vdp,
  406.                 RECTANGLE *EchoVP, ADDRESS args));
  407.  
  408. typedef  ADDRESS (*VOSMREALLOCFUNPTR)V_P_((char *ptr, unsigned int size));
  409.  
  410. /* To allow backward compatability.... */     
  411. typedef VOOBTRAVERSEFUNPTR VOOBTRAVERSEFUN;
  412. typedef VOGDRAWFUNPTR VOGDRAWFUN;
  413.  
  414. /*---------------------------------------------------------------------
  415. |
  416. |    VO??Statistic - For returning statistics about objects.
  417. */
  418. #define OBJECT_COUNT    ((int)('c'))
  419.  
  420.  
  421. /*---------------------------------------------------------------------
  422. |
  423. |    VOacCreate, VOacGetLanguage - Language flags.
  424. */
  425.  
  426. typedef enum 
  427.   { 
  428.   ACTIONLANGUAGE     /* action language */
  429.   } VI_ACLANGUAGE;
  430.  
  431. /*---------------------------------------------------------------------
  432. |
  433. |    VOcoCreate - Format flags.
  434. */
  435. #define COLOR_COMPONENTS    ((int)('c'))
  436. #define COLOR_INDEX        ((int)('i'))
  437. #define COLOR_NAME        ((int)('n'))
  438. #define COLOR_REFERENCE        ((int)('r'))
  439. #define COLOR_STRUCTURE        ((int)('s'))
  440.  
  441. /*---------------------------------------------------------------------
  442. |
  443. |    VOdqAdd - flags.
  444. */
  445. #define TOP        ((int)('t'))    /* top of dq */
  446. #define BOTTOM        ((int)('b'))    /* bottom of dq */
  447.  
  448. /*---------------------------------------------------------------------
  449. |
  450. |    VOdrBackcolor - color.
  451. |    A special color that indicates that the drawing has no
  452. |    background color, that is, the drawing has a transparent
  453. |    background.
  454. */
  455. #define NO_BACKGROUND -1
  456. #define V_NO_COLOR -1
  457.  
  458. /*---------------------------------------------------------------------
  459. |
  460. |    VOdrOffcolor - color.
  461. |    A special color that indicates that the off-drawing is not
  462. |    to be drawn.
  463. */
  464. #define NO_OFF_DRAWING_COLOR -1
  465.  
  466. /*---------------------------------------------------------------------
  467. |
  468. |    VOobEval Type flags
  469. */
  470. typedef enum
  471.   {
  472.   V_OB_EVAL_NULL = 0,
  473.   V_OB_EVAL_DRAW_STATIC,
  474.   V_OB_EVAL_DRAW_DYNAMIC,
  475.   V_OB_EVAL_DRAW_FULL,
  476.   V_OB_EVAL_DRAW_REPAIR,
  477.   V_OB_EVAL_ERASE,
  478.   V_OB_EVAL_DISPLAY_ENV_SET,
  479.   V_OB_EVAL_DONE,
  480.   V_OB_EVAL_DATA_RESET,
  481.   V_OB_EVAL_DATA_UPDATE,
  482.   V_OB_EVAL_SET_TO_UPDATE,
  483.   V_OB_EVAL_DATA_DONE,
  484.   V_OB_EVAL_DISPLAY_ENV_DONE,
  485.   V_OB_EVAL_DRAW_BG,
  486.   V_OB_EVAL_ERASE_BG,
  487.   V_OB_EVAL_DRAW_STARTUP,
  488.   V_OB_EVAL_ENV_SET_DRAW_FULL,
  489.   V_OB_EVAL_UPDATE_DRAW_DYNAMIC,
  490.   V_OB_EVAL_DISABLE_INPUT,
  491.   V_OB_EVAL_DRAW_DYNAMIC_INVISIBLE
  492.   } V_OB_EVAL_TYPE;
  493.  
  494. /* flag values for VOvpEvalExcept */
  495. #define V_EXCEPT_ABOVE  1
  496. #define V_EXCEPT_BELOW -1
  497. #define V_EXCEPT_ALL    0
  498.  
  499. /*---------------------------------------------------------------------
  500. |
  501. |    VOic - flags
  502. */
  503.  /* flags for create/get/set */
  504.  typedef enum
  505.   {
  506.   V_IC_ATTR_ARGEND = 0,
  507.   V_IC_HEIGHT,            /* height in screen coordinates */
  508.   V_IC_WIDTH,            /* width in screen coordinates */
  509.   V_IC_PIXMAP,            /* icon is based on this pixmap */
  510.   V_IC_PIXMAP_XFORM,    /* how to transform pixmap colors to device's */
  511.   V_IC_MASK_PIXMAP,        /* pixmap used for icon mask */
  512.   V_IC_MASK_PIXMAP_XFORM,   /* transform mask colors to draw/no draw */
  513.   V_IC_RASTER            /* actual raster used to draw icon */
  514.   } V_IC_ATTR_ENUM;
  515.  
  516.  
  517. /*---------------------------------------------------------------------
  518. |
  519. |    VOim - flags
  520. */
  521.  /* flags for create/get/set */
  522.  typedef enum
  523.   {
  524.   V_IM_ATTR_ARGEND = 0,
  525.   V_IM_PIXMAP,            /* image is based on this pixmap */
  526.   V_IM_PIXMAP_XFORM,    /* how to transform pixmap colors to device's */
  527.   V_IM_MASK_PIXMAP,        /* pixmap used for image mask */
  528.   V_IM_MASK_PIXMAP_XFORM,   /* transform mask colors to draw/no draw */
  529.   V_IM_RASTER            /* actual raster used to draw image */
  530.   } V_IM_ATTR_ENUM;
  531.  
  532.  
  533. /*---------------------------------------------------------------------
  534. |
  535. |    VOit - flags.
  536. */
  537. #define TEXT_LIST    't'    /* it pickable item list of text strings */
  538. #define OBJECT_LIST    'o'    /* it pickable item list  of objects */
  539. #define NO_LIST        (int)NULL    /* it no pickable item list */
  540.  
  541. /*---------------------------------------------------------------------
  542. |
  543. |    VOpm - flags
  544. */
  545.  /* flags for create/get/set */
  546. typedef enum
  547.   {
  548.   V_PM_ATTR_ARGEND = 0,
  549.   V_PM_HEIGHT,            /* height of pixmap in pixels */
  550.   V_PM_WIDTH,            /* width of pixmap in pixels */
  551.   V_PM_DEPTH,            /* color depth */
  552.   V_PM_COLOR_TABLE,        /* colors used by pixmap */
  553.   V_PM_INCLUDE_PIXELS,        /* pixmap type is include or reference */
  554.   V_PM_FILENAME,        /* name of external file for ref. pixmaps */
  555.   V_PM_RAW_DATA,        /* data (and length) for include pixmaps */
  556.   V_PM_BOUNDS,            /* creating raster: part of pix to use */
  557.   V_PM_COLOR_XFORM,             /* creating raster: color indices xform */
  558.   V_PM_VERSION,            /* # of changes since creation  */
  559.   V_PM_PIXREP_DATA        /* pixrep representation of pixmap */
  560.   } V_PM_ATTR_ENUM;
  561.  
  562.  
  563. /* Flags for pixmap graphic conversions. */
  564. typedef enum
  565.   {
  566.   V_PM_GIF,            /* Graphics Interchange Format (c)Compuserve */
  567.   V_PM_PPM,            /* Portable Pixmap */
  568.   V_PM_RASTER,            /* VI raster data */
  569.   V_PM_TIFF,            /* Tag Interchange File Format */
  570.   V_PM_BMP,            /* Microsoft .bmp format */
  571.   V_PM_PIXREP            /* VI internal device independent */
  572.   } V_PM_FORMAT_ENUM;
  573.  
  574.  
  575. /* Flags for pixmap flipping */
  576. typedef enum
  577.   {
  578.   V_PM_HORIZONTAL = 0,        /* Flip over horizontal axis */
  579.   V_PM_VERTICAL    = 1        /* Flip over vertical axis */
  580.   } V_PM_FLIP_ENUM;
  581.  
  582.  
  583. /* Ways of merging two pixmaps together. These flags determine how the color
  584.  | index of a pixel in the target pixmap is affected by the color index of
  585.  | the corresponding pixel in the source pixmap.
  586.  */
  587. typedef enum
  588.   {
  589.   V_PM_COPY,            /* source color index replaces target index */
  590.   V_PM_AND,            /* new target = source index AND old target */
  591.   V_PM_OR,            /* new target = source index OR  old target */
  592.   V_PM_XOR            /* new target = source index XOR old target */
  593.   } V_PM_MERGEMODE_ENUM;
  594.  
  595.  
  596. /*---------------------------------------------------------------------
  597. |
  598. |    VOptCreate - Format flags.
  599. */
  600. #define PIXEL_COORDINATES    ((int)('p'))    /* screen coordinate pt */
  601. #define SCREEN_COORDINATES    ((int)('p'))    /* screen coordinate pt */
  602. #define WORLD_COORDINATES    ((int)('w'))    /* world coordinate pt */
  603.  
  604. /*---------------------------------------------------------------------
  605. |
  606. |    VOptMove - Format flags.
  607. */
  608. #define DV_ABSOLUTE        'A'  /* move absolute pt by  absolute amount */
  609. #define DV_RELATIVE        'a'  /* move absolute pt by relative amount  */
  610. #define ADJUST_OFFSET_WORLD    'r'  /* adjust relative pt in world coords */
  611. #define ADJUST_OFFSET_SCREEN    'p'  /* adjust relative pt in screen coords */
  612.  
  613.  
  614. /*---------------------------------------------------------------------
  615. |
  616. |    VOsk reserved keynames and their sizes
  617. */
  618. #define V_NAMESLOT        "V_nameslot"
  619. #define V_NAMESLOTSIZE        1
  620.  
  621.  
  622. /*---------------------------------------------------------------------
  623. |
  624. |    VOsk type and method flags
  625. */
  626. #define VOSK_OBJECT_TYPE    ((int)'o')
  627. #define VOSK_DYN_OBJECT_TYPE    ((int)'d')
  628. #define VOSK_INT_TYPE        ((int)'i')
  629. #define VOSK_INT_ARRAY_TYPE    ((int)'I')
  630. #define VOSK_SHORT_TYPE        ((int)'s')
  631. #define VOSK_STRING_TYPE    ((int)'t')
  632. #define VOSK_FLOAT_TYPE        ((int)'f')
  633. #define VOSK_FLOAT_ARRAY_TYPE    ((int)'F')
  634. #define VOSK_EXTERNAL_TYPE    ((int)'x')
  635.  
  636. #define VOSK_ASSIGN_METHOD    ((int)'a')
  637. #define VOSK_CLONE_METHOD    ((int)'c')
  638. #define VOSK_DEASSIGN_METHOD    ((int)'d')
  639. #define VOSK_SAVE_METHOD    ((int)'s')
  640. #define VOSK_RETRIEVE_METHOD    ((int)'r')
  641.  
  642. /*---------------------------------------------------------------------
  643. |
  644. |    VOsmFOpen, VOsmFCreate - Access mode flags.
  645. */
  646. #define WRITE_COMPACT    ((int)('w'))
  647. #define WRITE_EXPANDED    ((int)('W'))
  648. #define READ_MODE    ((int)('r'))
  649.  
  650. /*---------------------------------------------------------------------
  651. |
  652. |    VOuObMove - Move mode flags.
  653. */
  654. #define ABSOLUTE_MOVE        'a'  /* move absolute pt by  absolute amount */
  655. #define RELATIVE_MOVE        'r'  /* move absolute pt by relative amount  */
  656.  
  657. /*---------------------------------------------------------------------
  658. |
  659. |    VOvpGridSet, VOvpGridGet - Get and set grid attributes
  660. */
  661. /* To turn on snapping to grid */
  662. #define V_VOVP_SNAP_TO_GRID       ((int)'s')    /* int flag */
  663. /* To turn on display of grid */
  664. #define V_VOVP_DRAW_GRID       ((int)'d')    /* int flag */
  665. /* To define the type of grid (adaptive or fixed */
  666. #define V_VOVP_ADAPTIVE_GRID       ((int)'a')    /* int flag */
  667. /* To set number of coordinates between grid marks */
  668. #define V_VOVP_GRID_SPACING       ((int)'g')    /* int value */
  669. /* Color object to use in drawing grid */
  670. #define V_VOVP_GRID_COLOR       ((int)'c')    /* OBJECT (LONG) color */
  671. /* To set spacing of grid tick marks */
  672. #define V_VOVP_MINOR_TICK_SPACING  ((int)'1')    /* int value */
  673. #define V_VOVP_MIDDLE_TICK_SPACING ((int)'2')    /* int value */
  674. #define V_VOVP_MAJOR_TICK_SPACING  ((int)'3')    /* int value */
  675.  
  676. /*---------------------------------------------------------------------
  677. |
  678. |    VOvpXfGet - Transform type flags
  679. */
  680. /* To get transformation from drawing coordinates to viewport coords */
  681. #define DR_TO_VP    1
  682. /* To get transformation from viewport coordinates to screen coords */
  683. #define VP_TO_SCREEN    2
  684. /* To get transformation from drawing coordinates to screen coords */
  685. #define DR_TO_SCREEN    3
  686. /* To get transformation from screen coordinates to drawing coords */
  687. /* (The inverse of the above transform) */
  688. #define SCREEN_TO_DR    4
  689.  
  690. /*---------------------------------------------------------------------
  691. |
  692. |    VOvd - type flags
  693. */
  694. #define COLOR    'c'        /* color type variable descriptor */
  695. #define NUMBER    'n'        /* number type variable descriptor */
  696. #define DV_TEXT    't'        /* text type variable descriptor */
  697.  
  698. /*====================================================================
  699. |
  700. |    OBJECT type codes
  701. |    Codes defining the objects and their type codes
  702. |    NOTE: type codes should be in the range [1,127]
  703. */
  704. #define LOWEST_TYPE_CODE  1
  705. #define HIGHEST_TYPE_CODE 42
  706.  
  707. #define OT_ACTION        35    /* VOac* routines */
  708. #define OT_ARC            1    /* VOar* routines */
  709. #define    OT_CONTROLLER_DEF    40    /* VOcd* routines */
  710. #define    OT_CONTROLLER        41    /* VOcr* routines */
  711. #define OT_CIRCLE        3    /* VOci* routines */
  712. #define OT_COLOR        4    /* VOco* routines */
  713. #define OT_DATASOURCE        6    /* VOds* routines */
  714. #define OT_DEQUE        7    /* VOdq* routines */
  715. #define OT_DG            8    /* VOdg* routines */
  716. #define OT_DRAWING        9    /* VOdr* routines */
  717. #define OT_DYNAMIC        37      /* VOdy* routines */
  718. #define    OT_EDGE            30    /* VOedge* routines */
  719. #define    OT_ELLIPSE        32    /* VOel* routines */
  720. #define    OT_EVENT        39    /* VOev* routines */
  721. #define OT_HEAP            10    /* VOhp* routines */
  722. #define OT_ICON          13    /* VOic* routines */
  723. #define OT_IMAGE        5    /* VOim* routines */
  724. #define OT_INPUT        27    /* VOin* routines */
  725. #define OT_INPUT_TECHNIQUE    28    /* VOit* routines */
  726. #define OT_LINE            11    /* VOln* routines */
  727. #define OT_LOCATION        12    /* VOlo* routines */
  728. #define    OT_NODE            31    /* VOnode* routines */
  729. #define OT_PARAMETER        14    /* VOpa* routines */
  730. #define OT_PIXMAP        2    /* VOpm* routines */
  731. #define OT_POINT        15    /* VOpt* routines */
  732. #define OT_POLYGON        16    /* VOpy* routines */
  733. #define OT_RECTANGLE        17    /* VOre* routines */
  734. #define OT_REFCOLOR        38    /* VOco* routines */
  735. #define OT_RULE            36    /* VOru* routines */
  736. #define OT_RGB            18    /* VOco* routines */
  737. #define OT_SCREEN           19    /* VOsc* routines */
  738. #define OT_SLOTKEY        33    /* VOsk* routines */
  739. #define OT_SLOTTABLE        34    /* VOst* routines */
  740. #define OT_STREAM           20    /* VOsm* routines */
  741. #define OT_SUBDRAWING        21    /* VOsd* routines */
  742. #define OT_TEXT            22    /* VOtx* routines */
  743. #define OT_THRESHTABLE        23    /* VOtt* routines */
  744. #define OT_VD            24    /* VOvd* routines */
  745. #define OT_VIEWPORT         25    /* VOvp* routines */
  746. #define OT_VTEXT             29    /* VOvt* routines */
  747. #define OT_XFORM        26    /* VOxf* routines */
  748. #define OT_SFTEXT               42      /* VOsf* routines */
  749.  
  750. /* Drawing information for the interaction handler */
  751. /* or display formatter */
  752. typedef struct DRAW_INFO
  753.   {
  754.   LONG ForeColor, BackColor; /* Color indices of foreground
  755.     | and background colors for the input object.  If these values
  756.     | are V_UNDEFINED it means that the interaction handler
  757.     | should get the colors from the layout. */
  758.   RECTANGLE
  759.     WorldVP, /* World coordinates VP for the interaction handler */
  760.     ScreenVP, /* Screen coordinates VP for the interaction handler */
  761.     ClipVP, /* Clipping viewport stored at the time of the VOinDraw */
  762.     **obsvps, /* Null-Terminated list of obscuring viewports */
  763.     VPused; /* Actual screen viewport (drawn part of the input) 
  764.            | used by the interaction handler.
  765.            | This is initially set by VOinDraw and MAY BE ADJASTED 
  766.            | BY AN INTERACTION HANDLER (VNmenu does it). */
  767.   OBJECT xform; /* Transform used in drawing the object */
  768.   ADDRESS SavedRaster; /* Address of the saved raster area */
  769.   OBJECT viewport;     /* Object's viewport */
  770.   } DRAW_INFO;
  771.  
  772. typedef struct DRAW_ENV
  773.   {
  774.    OBJECT xform;        /* Transformation to use when draw: 
  775.                usually is the same as viewport's one */
  776.    RECTANGLE *clipvp;   /* Clipping rect.: may be smaller or bigger than 
  777.                viewport boundaries */
  778.    RECTANGLE *termvp;  /* Special field to be terminate the list when
  779.               clipvp field is used as obsvps: we need a
  780.               terminating NULL. */
  781.    RECTANGLE **obsvps;     /* List of obscuring vps */
  782.    OBJECT viewport;     /* Viewport to draw the object in */
  783.    struct
  784.      {
  785.      unsigned int
  786.        inside_sd:1,        /* Currently evaluating inside a subdrawing */
  787.        pre_80_clr_dyn:1,    /* Config flag set to eval pre-8.0 clr dyns */
  788.        update_invis_graphs:1,    /* Config flag set to update invis graphs */
  789.        dy_enabled:1;            /* No disabled subdrawings above */
  790.     } flags;
  791. } DRAW_ENV;
  792.  
  793. typedef void (*VODROBDRAWFUNPTR) V_P_((OBJECT object, DRAW_ENV *de));
  794. typedef void (*VODROBERASEFUNPTR) V_P_((OBJECT object, DRAW_ENV *de));
  795. /*===================================================================
  796. |
  797. |    ASSIGN_OBJECT
  798. |    Assigns object B to location A, making sure that the objects
  799. |    are referenced and dereferenced properly.  Note that the
  800. |    dereference occurs AFTER the reference, to disallow
  801. |    destroying the object when assigning it to a location
  802. |    that already has the object in it. Note also that the macro
  803. |    is written so that B appears only once, in case it is
  804. |    a function call.  This macro is useful for anytime that
  805. |    an object is to assigned to a location (e.g. field in a
  806. |    structure) that may already have an object in it.
  807. |    Because VOobReference accepts a NULL object without complaint,
  808. |    this macro also works to clear a location when you are done.
  809. */
  810. #define ASSIGN_OBJECT( A, B ) \
  811.   { \
  812.   OBJECT temp; \
  813.  \
  814.   temp = A; \
  815.   A = VOobReference( B ); \
  816.   if( temp ) VOobDereference( temp ); \
  817.   }
  818.  
  819. /* ==================================================================
  820.   The defines below are for pre-9.0 compatibility. If compiling a
  821.   file with pre-9.0 defines, set "V_8TO9_COMPATIBILITY" before
  822.   including this file */
  823.  
  824. #ifdef V_8TO9_COMPATIBILITY
  825.  
  826. #define DYN_ROTATE        V_DYN_ROTATE
  827. #define DYN_PATH_MOVE        V_DYN_PATH_MOVE
  828. #define DYN_REL_MOVE_X        V_DYN_REL_MOVE_X
  829. #define DYN_REL_MOVE_Y        V_DYN_REL_MOVE_Y
  830. #define DYN_ABS_MOVE_X        V_DYN_ABS_MOVE_X
  831. #define DYN_ABS_MOVE_Y        V_DYN_ABS_MOVE_Y
  832. #define DYN_SCALE        V_DYN_SCALE
  833. #define DYN_SCALE_X        V_DYN_SCALE_X
  834. #define DYN_SCALE_Y        V_DYN_SCALE_Y
  835. #define DYN_SUBDRAWING        V_DYN_SUBDRAWING
  836. #define DYN_FILL_RIGHT        V_DYN_FILL_RIGHT
  837. #define DYN_FILL_UP        V_DYN_FILL_UP
  838. #define DYN_FILL_LEFT        V_DYN_FILL_LEFT
  839. #define DYN_FILL_DOWN        V_DYN_FILL_DOWN
  840.  
  841. #define DYN_ERASE_REDRAW    V_DYN_ERASE_REDRAW
  842. #define DYN_ERASE_RASTER    V_DYN_ERASE_RASTER
  843. #define DYN_ERASE_BGCLR        V_DYN_ERASE_BGCLR
  844. #define DYN_ERASE_XOR        V_DYN_ERASE_XOR
  845. #define DYN_ERASE_NONE        V_DYN_ERASE_NONE
  846.  
  847. #endif /* V_8TO9_COMPATIBILITY */
  848.  
  849.  
  850. /* Backward compatibility of upgraded typedefs and defines */
  851. #ifdef DV_OLD_NAMES
  852. #define TRANSPARENT DV_TRANSPARENT
  853. #define ABSOLUTE DV_ABSOLUTE
  854. #define RELATIVE DV_RELATIVE
  855. #define SUCCESS DV_SUCCESS
  856. #define FAILURE DV_FAILURE
  857. #define TEXT DV_TEXT
  858. #endif /* DV_OLD_NAMES */
  859.  
  860. #endif /* VOSTD_H */
  861.